set(PKG_DESC "CMinPack")
set(PKG_EXTERNAL_DEPS "")
set(pkg_conf_file ${CMAKE_CURRENT_BINARY_DIR}/cminpack.pc)
if (USE_BLAS AND CBLAS_FOUND)
    set(PC_CMINPACK_CFLAGS "-DUSE_CBLAS")
    if (NOT "${BLAS_LIBRARIES}" STREQUAL "")
        string(REPLACE ";" " -l" PC_CMINPACK_LIBRARIES "${BLAS_LIBRARIES}")
        set(PC_CMINPACK_LIBRARIES "-l${PC_CMINPACK_LIBRARIES}")
    endif()
    set(PC_CMINPACK_LDFLAGS "${BLAS_LINKER_FLAGS}")
endif()
configure_file(cminpack.pc.in ${pkg_conf_file} @ONLY)
install(FILES ${pkg_conf_file}
    DESTINATION ${CMINPACK_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT pkgconfig)

install(EXPORT CMinpackConfig DESTINATION share/cminpack NAMESPACE cminpack::)